using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using Leo.Entities;

namespace Leo.Repository.Mapping
{
    public class DETALLECOMPROBANTEMap : EntityTypeConfiguration<DETALLECOMPROBANTE>
    {
        public DETALLECOMPROBANTEMap()
        {
            // Primary Key
            this.HasKey(t => new { t.idDetalle_comprobante, t.id_comprobante });

            // Properties
            this.Property(t => t.idDetalle_comprobante)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);

            this.Property(t => t.id_comprobante)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            // Table & Column Mappings
            this.ToTable("DETALLECOMPROBANTE");
            this.Property(t => t.idDetalle_comprobante).HasColumnName("idDetalle_comprobante");
            this.Property(t => t.id_comprobante).HasColumnName("id_comprobante");
            this.Property(t => t.id_venta).HasColumnName("id_venta");
            this.Property(t => t.fecha).HasColumnName("fecha");
            this.Property(t => t.total).HasColumnName("total");
        }
    }
}
